import { Model } from '/@/api/model/baseModel';

/**
 * @description: Login interface parameters
 */
export interface LoginReq {
  /**
   * 用户名
   */
  username: string;
  /**
   * 密码
   */
  password: string;
  /**
   * 验证码
   */
  verifyCode?: string;
  /**
   * 系统ID
   */
  systemId?: string;
}

/**
 * 登录toke
 */
export interface LoginResp {
  accessToken: string;
  refreshToken?: string;
  tokenType?: string;
  expiresIn?: string;
  iat?: string;
  jti?: string;
}

/**
 * 用户信息
 */
export interface UserInfoResp extends Model {
  id?: string;
  systemId?: string;
  iconFileUrl?: string;
  username?: string;
  icon?: string;
  email?: string;
  realName?: string;
  nickName?: string;
  homeRoleId?: string;
  note?: string;
  extAttribute?: string;
  homePath?: string;
  roleIds?: string[];
  deptIds?: string[];
  permissionIds?: string[];
  componentPermissions?: ComponentPermission[];
}

/**
 * 角色信息
 */
export interface UserRole extends Model {
  id?: string;
  systemId?: string;
  roleName?: string;
  roleCode?: any;
  note?: string;
  sort?: number;
}

/**
 * 组件权限
 */
export interface ComponentPermission {
  menuId?: string;
  routerPath?: string;
  components?: MenuComponent[];
  componentCodes?: string[];
}

/**
 * 菜单控件
 */
export interface MenuComponent {
  menuId?: string;
  componentTitle?: string;
  componentCode?: string;
}

/**
 * 部门信息
 */
export interface UserDept extends Model {
  id: string;
  systemId: string;
  parentId: string;
  deptName: string;
  deptCode: string;
  note: string;
  sort: number;
}
